Shared Memory Block Configuration

ABSTRACT

A network switch device is described. The network switch device includes a plurality of processor devices configured to perform different respective functions of the network switch device, a block of shared memory having a plurality of single port memory banks, and a memory controller configured to allocate respective sets of banks among the single port memory banks to processor devices among the plurality of processor devices, and determine respective configurations of the sets of memory banks as one of i) a single port configuration in which respective single port memory banks support a single read or write memory operation to a memory location in a memory access cycle, and ii) a virtual multi-port configuration in which respective single port memory banks support two or more concurrent read or write memory operations to a same memory location, based on memory access requirements of the corresponding processor device.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Patent App. No.62/712,066, entitled “Flexible Memory Design for Shared Memory,” filedon Jul. 30, 2018, the disclosure of which is hereby expresslyincorporated herein by reference in its entirety.

FIELD OF THE DISCLOSURE

The present disclosure relates generally to communication networks and,more particularly, to configurable shared memory suitable for networkdevices.

BACKGROUND

The background description provided herein is for the purpose ofgenerally presenting the context of the disclosure. Work of thepresently named inventors, to the extent it is described in thisbackground section, as well as aspects of the description that may nototherwise qualify as prior art at the time of filing, are neitherexpressly nor impliedly admitted as prior art against the presentdisclosure.

Some network devices, such as network switches, bridges, routers, etc.,employ multiple processor engines to concurrently process multiplepackets with high throughput. The processor devices utilize memory banksto provide various functions of the network switch device, for example,longest exact match engines for routing, forwarding table lookups thatdetermine egress ports for packets, packet buffers that store packetswhile processing is performed, and hash engines that determine hashoutputs.

In various network devices, an effort is made to design systems havingshared memory space which is shared among different processor engines.Some memory banks are provided with a single physical port (“single portmemory”), which generally allows for one memory access per clock cycle,while other memory banks are provided with two or more physical ports(“dual port memory” or “multi-port memory”), which generally allow fortwo or more memory accesses per clock cycle. In some systems the memoryports are physical, while in other systems single port memory devicesare adapted to provide virtual dual port or multi-port capabilities.However, dual port and multi-port memories, whether the ports arephysical or virtual, typically have a higher cost and/or complexityand/or reduced capacity in comparison to single port memories, thus dualport and multi-port memories are less desirable in some scenarios,particularly when their additional capability is not necessary for aparticular application.

SUMMARY

In an embodiment, a network switch device includes a plurality ofprocessor devices, a block of shared memory having a plurality of singleport memory banks, and a memory controller. The plurality of processordevices are configured to perform different respective functions of thenetwork switch device. The block of shared memory is shared among theplurality of processor devices. The memory controller configured toallocate respective sets of banks among the plurality of single portmemory banks to processor devices among the plurality of processordevices, and determine respective configurations of the sets of memorybanks as one of i) a single port configuration in which respectivesingle port memory banks support a single read or write memory operationto a memory location in a memory access cycle, and ii) a virtualmulti-port configuration in which respective single port memory bankssupport two or more concurrent read or write memory operations to a samememory location, based on memory access requirements of thecorresponding processor device.

In another embodiment, a method for providing access to a block ofshared memory having a plurality of single port memory banks includes:allocating, by a memory controller of a network switch device thatincludes the block of shared memory and a plurality of processor devicesconfigured to perform different respective functions of the networkswitch device, respective sets of banks among the plurality of singleport memory banks to processor devices among the plurality of processordevices, the block of shared memory being shared among a plurality ofprocessor devices; determining, by the memory controller, respectiveconfigurations of the sets of memory banks as one of i) a single portconfiguration in which respective single port memory banks support asingle read or write memory operation to a memory location in a memoryaccess cycle, and ii) a virtual multi-port configuration in whichrespective single port memory banks support two or more concurrent reador write memory operations to a same memory location, based on memoryaccess requirements of the corresponding processor device; andconfiguring, by the memory controller, a connectivity controller of thenetwork switch device to couple the plurality of processor devices tothe block of shared memory and provide the respective processor deviceswith access to the corresponding sets of banks according to thedetermined configurations.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of an example network switch device having ashared memory block, according to an embodiment;

FIG. 2A is a diagram of an example single port configuration of thememory block of FIG. 1, according to an embodiment;

FIG. 2B is a diagram of an example virtual dual port configuration ofthe memory block of FIG. 1, according to an embodiment;

FIG. 3 is a diagram of an example dual single port configuration of thememory block of FIG. 1, according to an embodiment;

FIG. 4 is a diagram illustrating an example method for providing accessto a shared memory block having a plurality of single port memory banks,according to an embodiment.

DETAILED DESCRIPTION

Various embodiments of a network switch device that utilizes multipleprocessor devices to concurrently process packets are described herein.In some embodiments, the multiple processor devices are arranged inmultiple processor pipelines, each pipeline having one or more processordevices, and the multiple processor devices are configured to use ashared memory. Memory banks are configured to be accessed using one ormore memory ports. Basic memory banks typically have one memory port(“single port”), which generally allows for one memory access per clockcycle, while more advanced memories have two memory ports (“dual port”)or more than two memory ports (“multi-port”), which generally providefor two or more memory accesses per clock cycle. However, dual port andmulti-port memories, whether the ports are physical or virtual,typically have a higher cost and/or complexity and/or reduced capacityin comparison to single port memories, thus dual port and multi-portmemories are less desirable in some scenarios, particularly when theiradditional capability is not necessary for a particular application.

The network switch device includes a memory controller and a block ofshared memory having a plurality of single port memory banks, in variousembodiments. The memory controller is configured to share the block ofshared memory among the plurality of processor engines, which in anembodiment are coupled together to form one or more packet processingpipelines, or among a plurality of processors, and to provide theprocessor engines with access to the single port memory banks inaccordance with a suitable memory configuration, in an embodiment. Thememory controller determines a memory configuration for a processordevice based on memory access requirements of the processor device, invarious embodiments, for example, as a function of the nature ofoperations that are to be performed by the processing engines that needto access the shared memory and/or of the type of data to be stored inthe memory. Examples of the memory configurations include one or more ofa single port configuration, a virtual multi-port configuration, and adual single port configuration, in various embodiments. The differentmemory configurations respectively provide different memory performanceparameters, even though the same single port memory banks are utilizedfor the different memory configurations. In an embodiment, for example,a single port configuration provides a larger address space but loweraccess frequency (i.e. a lesser ability by plural devices to access asame memory space in a given clock cycle) as compared to a virtualmulti-port (e.g., virtual dual port) configuration. Similarly, a singleport memory may be able to more readily provide repeated read and/orwrite access to a same addressable memory location in consecutive clockcycles than a dual port or multi-port memory. Moreover, the provision ofvirtual dual-port or virtual multi-port functionality may require thededication of some memory cells, for example within a block of memoryassigned to a specific processing engine, to temporarily store data,such as parity data needed for dual or multi-port functionality, and/orto enable access in consecutive clock cycles, thereby reducing the sizeof available memory. In some embodiments, the memory controllerdetermines different configurations of memory banks for differentprocessor devices according to the requirements of the processor devicesto access memory space in order to provide a particular functionality.

FIG. 1 is a simplified block diagram of an example network switch device100, according to an embodiment. The network switch device 100 includesa memory controller 102, one or more blocks of shared memory 130, and aplurality of processor devices 140, such as processor engines in apacket processing pipeline. The plurality of processor devices 140 areconfigured to perform different respective functions of the networkswitch device 100. In the embodiment shown in FIG. 1, the plurality ofprocessor devices 140 (referred to herein as processor devices 140)includes an integer number k processor devices, shown as processordevice 1 (141), processor device 2 (142), and processor device k (143).In various embodiments, the integer number k is 1, 2, 3, 16, 64, oranother suitable number. The processor devices 140 utilize the blocks ofshared memory 130 to provide the functions of the network switch device100. Examples of the processor devices 140 include longest exact matchengines for routing, tunnel start engines, longest prefix match (LPM)engines, address resolution protocol (ARP) engines, forwarding tablelookups (e.g., forwarding database and/or media access control table)that determine egress ports of the network switch device (not shown) forpackets, policer engines that limit input or output transmission rates,and other suitable processor devices. In some embodiments, the processordevices 140 provide different functions. In an embodiment, for example,the processor device 141 is a longest exact match engine, the processordevice 142 is a forwarding table lookup engine, and the processor device143 is a policer engine. In another embodiment, both the processordevice 141 and the processor device 142 are longest exact match enginesand the processor device 143 is a policer engine. In other embodiments,the network switch device 100 includes a different combination ofprocessor devices.

The blocks of shared memory 130 (also referred to herein as a “memoryblock 130”) includes a plurality of single port memory banks 132. In theembodiment shown in FIG. 1, the plurality of single port memory banks132 (referred to herein as memory banks 132) includes an integer numbern of memory banks, shown as bank 1, bank 2, bank 3, bank 4, and bank n.In various embodiments, the integer number n is 2, 3, 8, 16, or anyother suitable number. In some embodiments, the network switch device100 includes only single port memory banks, such as the memory banks132. In other embodiments, the network switch device 100 includes singleport memory banks 132, as well as other, multi-port memory banks (e.g.,dual port memory banks). Although only a single memory block 130 isshown in FIG. 1, the network switch device 100 includes two, three, ormore memory blocks in other embodiments.

The memory controller 102 is configured to cause access to the memoryblock 130 to be shared among the processor devices 140, in variousembodiments. For example, the memory controller 102 is configured toallocate respective sets of banks among the memory banks 132 to theprocessor devices 140. In an embodiment, for example, the memory block130 includes 24 banks and the memory controller 102 allocates a set ofeight memory banks to processor device 141, allocates six memory banksto processor device 142, and allocates ten memory banks to processordevice 143. In another embodiment, for example, the memory block 130includes 16 banks and the memory controller 102 allocates a first set ofeight memory banks to processor devices 141 and 142 and allocates asecond set of eight memory banks to processor device 143.

The memory controller 102 is configured, in an embodiment, to determinerespective configurations of the sets of memory banks as one of i) asingle port configuration in which respective single port memory bankssupport a single read or write memory operation to a memory location(e.g., within a same bank) in a memory access cycle, and ii) a virtualmulti-port configuration in which respective single port memory bankssupport two or more concurrent read or write memory operations to a samememory location (e.g., within a same bank), based on memory accessrequirements of the corresponding processor device, in variousembodiments. In some embodiments, the memory controller 102 isconfigured to both allocate sets of memory blocks 130 and/or memorybanks 132 to one or more processor devices 140 as well as determine therespective configurations of the memory banks 130. Although the memorybanks 132 are single port memory banks and are individually capable ofexecuting no more than a single read command or a single write commandper clock cycle (or memory access cycle), the memory controller 102 isconfigured, in some embodiments and/or scenarios, to execute multiplememory operations (e.g., a read command or write command) per memoryaccess cycle by utilizing virtual multi-port configurations, asdescribed herein. In various embodiments, the virtual multi-portconfigurations provide a larger number of read and/or write commands permemory access cycle. In some embodiments, the multi-port configurationsinclude those described in U.S. Pat. No. 8,514,651 entitled “SharingAccess to a Memory Among Clients,” U.S. Pat. No. 10,089,018 entitled“Multi-Bank Memory with Multiple Read Ports and Multiple Write Ports PerCycle,” U.S. Patent Application Publication No. 2016/0320989 entitled“Multi-Bank Memory with One Read Port and One or more Write Ports PerCycle,” U.S. Patent Application Publication No. 2016/0321184 entitled“Multiple Read and Write Port Memory,” and U.S. Patent ApplicationPublication No. 2017/0364408 entitled “Multiple Read and Write PortMemory,” the contents of which are incorporated herein by reference intheir entirety. In some embodiments, the memory controller 102 isconfigured to provide a multi-port configuration in which respectivesingle port memory banks support two concurrent read or write memoryoperations to a same memory location, based on memory accessrequirements of the corresponding processor device.

The memory controller 102 includes control logic 110 and a connectivitycontroller 120, in an embodiment. The control logic 110 is a processorimplemented on an integrated circuit for example, using one or moreapplication-specific integrated circuits (ASICs), programmable logicdevices (PLDs), or other discrete hardware components. The control logic110 is coupled with the plurality of processor devices 140, where eachof the processor devices 140 has one or more (up to an integer m) memoryconnections, in an embodiment. The control logic 110 is configured toallocate respective sets of banks to the processor devices 140, and todetermine the respective configurations of the sets of memory banksbased on memory access requirements of the corresponding processordevice. In an embodiment, the control logic 110 receives a userconfiguration (“Config”) that identifies the memory access requirementsof the processor devices 140. In an embodiment, the user configurationincludes an indication of an estimated memory size requirement and/or anestimated average frequency of access for a processor device. In anembodiment, the user configuration indicates the following requirements:

Number of Memory Accesses Total Memory Size Engine 1 4 32 KB Engine 2 16128 KB Engine 3 8 64 KB

In another embodiment, the user configuration indicates the followingrequirements:

Number of Memory Accesses Total Memory Size Engine 1 8 64 KB Engine 2 432 KB Engine 3 8 64 KB

In other embodiments, the user configuration indicates a device type ofthe processor devices 140. In one such embodiment, the control logic 110is configured to determine the memory access requirements using thedevice type where the device type is one of a plurality of differentdevice types that correspond to respective predetermined memory accessrequirements.

In an embodiment, for example, a device type such as a forwarding tablelookup engine or other processor device having a more chaotic pattern ofaccess corresponds to a multi-port configuration that provides arelatively higher number of concurrent memory read accesses per cycle.Such a requirement may occur for example in the context of memory thatis used to store forwarding tables which may need to be concurrentlyaccessed by several processing engines to make forwarding decisions forincoming network packets. A suitable configuration for such use may be avirtual multi-port system that facilitates multiple concurrent readaccesses at any given memory address. For some device types, it may bedesirable to facilitate, in addition to concurrent read operation, theability to also perform concurrent or interleaved write operations. Instill another example, a device type, such as a packet buffer, that isconfigured to store packets while packet headers are being processed fora fixed time period, typically has a more systematic and orderlyexpected pattern of access, for which a single port configurationoffering a relatively lower number of memory accesses per cycle, butproviding memory that is more dense per unit area may be more suitable.

The connectivity controller 120 of the memory controller 102 isconfigured to couple the plurality of processor devices 140 with theblock of shared memory 130 based on the configuration (“Control”)indicated by the control logic 110. In an embodiment, the connectivitycontroller 120 includes n memory access ports that correspond to the nmemory banks of the memory block 130. In an embodiment, the connectivitycontroller 120 implements a memory connectivity network, such as thememory connectivity network described in U.S. Patent ApplicationPublication No. 2014-0177470, the contents of which are incorporatedherein by reference in their entirety. In various embodiments, thecontrol logic 110 determines the memory access requirements of theprocessor devices 140 during a configuration stage (e.g., during bootup)of the network switch device 100 that precedes an operational stage(e.g., while processing packets) and configures the connectivitycontroller 120 accordingly. In some embodiments, a same memory bank ispart of a different memory configuration at different times. In anembodiment, for example, a memory bank is utilized in single portconfiguration for a first operational stage of the network switchdevice, but utilized in a virtual dual port configuration for a secondoperational stage of the network switch device.

FIG. 2A is a diagram of an example single port configuration 200 of thememory block of FIG. 1, according to an embodiment. FIG. 2B is a diagramof an example virtual dual port configuration 250 of the memory block ofFIG. 1, according to an embodiment. FIG. 3 is a diagram of an exampledual single port configuration 300 of the memory block of FIG. 1,according to an embodiment. In the embodiments shown in FIGS. 2A, 2B,and 3, the plurality of memory banks 132 in a memory block 130 includeseight single port memory banks 202, 204, 206, 208, 210, 212, 214, and216. The memory banks 214 and 216 are one half of the capacity of theremaining memory banks to allow for the dual single port configuration300, as described below. In an embodiment, for example, the memory banks202, 204, 206, 208, 210, and 212 are single port memory banks eachhaving a storage capacity of 2048 address spaces (e.g., addresses of 0to 2047) and the memory banks 214 and 216 are single port memory bankshaving a storage capacity of 1024 address spaces (e.g., addresses of 0to 1023). In various embodiments, each address space corresponds to asingle bit, a multi-bit word (e.g., two, three, or more bits), one byte(8 bits), multiple bytes, or any other suitable data size. In someembodiments, half-size memory banks 214 and 216 are omitted and theplurality of memory banks 132 includes only memory banks having a samesize.

In the embodiment of the single port configuration 200 shown in FIG. 2A,the memory controller 102 provides a single memory access (i.e., asingle read operation or a single write operation) per memory accesscycle with a single addressable memory space. In an embodiment, forexample, the memory controller 102 allocates a set of memory banks to aprocessor device and designates each bank of the set of banks as acontent data bank and stores content data (e.g., control tables,forwarding tables, routing tables, or other suitable data). In thisembodiment, the set of memory banks includes the plurality of memorybanks 132 and content data banks 220 include each of the memory banks202, 204, 206, 208, 210, 212, 214, and 216. In this embodiment, theaddressable memory space covers each bank of the set of memory banks andhas a size of 14K addressable spaces (i.e., 2048*6=12 k for banks 0-5and 1024*2=2 k for banks 7 and 8). In an embodiment, the memorycontroller 102 maps addresses of 0-2047 to the first memory bank 202(Bank 0), maps addresses of 2048-4095 to the second memory bank 204(Bank 1), and so on. In this way, the block of shared memory 130 isaddressable using an address of 0-2047 along with an offset thatcorresponds to the appropriate memory bank (i.e., an offset of “0” forBank 0, an offset of “2048” for Bank 1, etc.). In the single portconfiguration 200 shown in FIG. 2A, the memory controller 102 mapsaddresses of 12 k to 13 k−1 to Bank 6 and maps addresses of 13 k to 14k−1 to Bank 7.

In the embodiment of the virtual dual port configuration 250 shown inFIG. 2B, the memory controller 102 provides two memory accesses permemory access cycle with a single addressable memory space. In anembodiment, for example, the memory controller 102 allocates a set ofmemory banks to a processor device and designates i) at least one bankof the set of banks as a parity bank 260, and ii) remaining banks of theset of banks as content data banks 220. In this embodiment, the set ofmemory banks includes the plurality of memory banks 132, the contentdata banks 220 include memory banks 202, 204, 206, 208, 210, and 212,and the parity banks 260 include memory banks 214 and 216. In thisembodiment, the addressable memory space covers the content data banksand has a size of 12K addressable spaces (i.e., 2048*6 for banks 0-5),while the memory banks 214 and 216 are not used for content data.

In an embodiment, the parity banks 260 store an “exclusive OR” (“XOR”)of the content data stored in the content data banks at the same memoryaddress. When both of the virtual memory ports attempt to access a samememory bank, a first memory access is read from the bank while thesecond memory access is read from the remaining banks including theparity banks and performing an XOR to obtain the desired data. In anembodiment, as an example, the processor device 141 requests two readoperations on address locations “2060” and “2066” during a same memoryaccess cycle. These address locations are both located within (e.g.,mapped to) a same memory bank 204 (i.e., bank 1). In an embodiment, forexample, the memory controller 102 performs a first read operation(e.g., at address 12, which is 2060 minus the offset of 2048 for Bank 1)on the bank 204 and performs a second read operation (e.g., at address18, which is 2066 minus the offset of 2048 for Bank 1) along with an XORoperation on the remaining content data banks 202, 206, 208, 210, 212,and the parity bank 214. In other words, the memory controller 102reconstructs the content data at mapped address 18 of Bank 1(corresponding to address 2066) by performing Bank0(18) XOR Bank2(18)XOR Bank3(18) XOR Bank4(18) XOR Bank5(18) XOR Bank6(18), where“Bank0(18)” represents the content data at address 18 of Bank 0, etc. Asanother example, the memory controller 102 reconstructs the content dataat mapped address 1030 of Bank 4 (corresponding to address 9222, or 1030plus an 8 k offset for Bank 4) by performing Bank0(1030) XOR Bank1(1030)XOR Bank2(1030) XOR Bank3(1030) XOR Bank5(1030) XOR Bank7(6). In thisexample, an additional offset of 1024 is applied for Bank 7 to accountfor the reduced sizes of Bank 6 and Bank 7, which have only 1024addresses.

In a related configuration, in some embodiments, it may be necessary toprovide concurrent access to more than two processor engines. In such acase, in accordance with various virtual multi-port virtualizationtechniques described for example in U.S. Pat. No. 8,514,651,incorporated herein by reference, additional XOR banks are selectablyprovided for example to hold parity data for rows, columns and/or cornerlocations of memory banks for those memory banks configured as virtualmulti-port memories. Although additional concurrent access can beprovided in such implementations, an increased quantity of XOR banksfurther reduces available memory space for holding data such asforwarding tables.

In the embodiment of the dual single port configuration 300 shown inFIG. 3, the memory controller 102 provides two memory accesses permemory access cycle with two distinct addressable memory spaces. In anembodiment, for example, the memory controller 102 allocates a set ofmemory banks to a processor device, designates a first portion of theset of banks as first content data banks having a first address space,and designates a second, remaining portion of the set of banks as secondcontent data banks having a second address space that is distinct fromthe first address space. In this embodiment, the set of memory banksincludes the plurality of memory banks 132, the first content data banks320 includes memory banks 202, 204, 206, and 214, and the second contentdata banks 340 includes memory banks 208, 210, 212, and 216. In anembodiment, for example, the first address space has a size of 7Kaddressable spaces (i.e., 2048*3 for Banks 0 to Bank 2 plus 1024 forBank 6), the second address space has a size of 7K addressable spaces(i.e., 2048*3 for Banks 3 to Bank 5 plus 1024 for Bank 7). In thisembodiment, the first address space is distinct from the second memoryspace and the first address space (e.g., addresses 0 to 7 k−1) isaccessible to the corresponding processor device by a “first port” andthe second address space (e.g., 7 k to 14 k−1) is accessible to thecorresponding processor device by a “second port” during a same memorycycle. The dual single port configuration 300 allows the use of theplurality of memory banks 132 as two small (i.e., 7K) memories insteadof a single, large (i.e., 14 k) memory, in an embodiment. In somescenarios, the dual single port configuration 300 is utilized (e.g.,configured using the user configuration “Config”) for engines thatrequire smaller memory banks with improved resolution, such as, forexample, longest prefix match (LPM) routing engines. In an embodiment,for example, the memory controller 102 configures a set of memory banksfor an LPM routing engine with a relatively high number of memory portsto the shared memory (28 memory ports corresponding to 28 memory banksarranged as 14 instances of the configuration shown in FIG. 3, forexample). In some use cases, the LPM routing engine need only beconnected to relatively small banks (e.g., 7 k instead of 14 k), so thedual single port configuration 300 allows improved utilization of theshared memory 130, for example, by avoiding the need to allocate afull-size block 130 having more capacity (e.g., 28*14 k) than the LPMrouting engine needs.

By switching memory configurations of the memory banks 132 between theconfigurations 200, 250, and 300, the logic control 110 avoids memorybanks being “wasted” as a parity bank when the increased accessfrequency provided by the parity bank is not needed, in someembodiments. Example embodiments of engines (e.g., processor devices140) and configurations are defined in Table 1 below:

TABLE 1 Required Memory Engine ports Access type Attributesconfiguration ARP + Dual Random Access ARP and TS can Virtual dualTunnel Read x2 be mapped to port Start same bank (XOR) MAC Dual x16Random Access 2 interfaces, Virtual dual table Read x16 x2, each havingport (FDB) Write x2 16x addresses (XOR) LPM Single x28 Read x28 Manybanks Single port, Dual single port Exact Dual x16 Random Access 2interfaces, Virtual dual Match Read x16 x2, each having port Write x216x addresses (XOR)

In the example embodiments shown in Table 1, the memory controller 102configures a set of memory banks using the virtual dual portconfiguration 250 for the address resolution protocol (ARP) routingengine and tunnel start engine. In an embodiment, the ARP routing engineand the tunnel start engine can be mapped to a same bank and the virtualdual port configuration 250 allows for their concurrent access. Invarious embodiments, the ARP engine is provided without the tunnel startengine, the ARP engine is provided with an IPv4 tunnel start engine, oran IPv6 tunnel start engine without the ARP engine.

In an embodiment, the memory controller 102 configures the block ofshared memory 130 as single port memory banks supporting only a singlememory access operation in a given memory access cycle, but having aplurality of separately addressable memory locations, for example, 16 ofthe single port memory banks 132, using the virtual dual portconfiguration 250 for the MAC table. In other words, the memorycontroller 102 configures the content data banks 220 to include 16separate memory banks. This configuration improves random access reads,for example, for MAC source address and MAC destination address lookups,which may hit a same memory bank. In an embodiment, the memorycontroller 102 configures the block of shared memory 130 (or anotherblock of shared memory, not shown) using the virtual dual portconfiguration 250 for an exact match engine, in a manner similar to thatprovided for the MAC table engine. This configuration improves randomaccess reads, for example, for exact match searches that may hit a samememory bank.

In an embodiment, the memory controller 102 configures the block ofshared memory 130 as dual single port memory banks, each memory banksupporting only a single memory access operation in a given memoryaccess cycle, using the dual single port configuration 300 for thelongest prefix match (LPM) engine. In an embodiment, the dual singleport configuration 300 for the LPM engine includes 28 groups of contentdata banks, for example, 14 instances of the first content data banks320 and second content banks 340.

FIG. 4 is a flow diagram illustrating an example method 400 forproviding access to a shared memory block having a plurality of singleport memory banks, according to an embodiment. In an embodiment, themethod 400 is implemented by a memory controller of a network switchdevice. With reference to FIG. 1, the method 400 is implemented by thememory controller 102, in an embodiment. For example, in one suchembodiment, the control logic 110 is configured to implement the method400. In the method 400, a memory controller of a network switch deviceincludes the block of shared memory and a plurality of processor devicesconfigured to perform different respective functions of the networkswitch device. In an embodiment, the network switch device is thenetwork switch device 100.

At block 402, respective sets of banks are allocated by the memorycontroller among the plurality of single port memory banks to processorengines among the plurality of processor engines. The block of sharedmemory is shared among a plurality of processor devices.

At block 404, respective configurations of the sets of memory banks aredetermined by the memory controller as one of i) a single portconfiguration in which respective single port memory banks support asingle read or write memory operation to a memory location in a memoryaccess cycle, and ii) a virtual dual port or multi-port configuration inwhich respective single port memory banks support two or more concurrentread or write memory operations to a same memory location, based onmemory access requirements of the corresponding processor device. In anembodiment, the single port configuration corresponds to the single portconfiguration 200 of FIG. 2 and the virtual multi-port configurationcorresponds generally to the virtual dual port configuration 300 of FIG.3.

In some embodiments, determining the respective configurations of thesets of memory banks includes determining the respective configurationsbased on one or more of i) an estimated memory size requirement of thecorresponding processor device, and ii) an estimated average frequencyof access to the block of memory by the corresponding processor device.In an embodiment, for example, the memory controller 102 determines theconfiguration as the single port configuration 200 for a processordevice having i) a relatively high estimated memory size requirement, orii) a relatively low frequency of access.

In an embodiment, determining the respective configurations of the setsof memory banks includes determining the memory access requirements ofthe plurality of processor devices during a configuration stage of thenetwork switch device that precedes an operational stage of the networkswitch device. For example, the memory controller 102 determines theconfigurations of the sets of memory banks during a bootup stage beforethe network switch device 100 begins processing packets.

In some embodiments, determining the respective configurations of thesets of memory banks includes determining the memory access requirementsusing a device type of the processor device. In an embodiment, forexample, the device type is one of a plurality of different device typesthat correspond to respective predetermined memory access requirements.

At block 306, a connectivity controller of the network switch device isconfigured by the memory controller to couple the plurality of processordevices to the block of shared memory and provide the respectiveprocessor devices with access to the corresponding sets of banksaccording to the determined configurations. In an embodiment, theconnectivity controller corresponds to the connectivity controller 120of the network switch device 100.

In some embodiments, when the memory controller 102 determines theconfiguration of the set of banks as the single port configuration, thememory controller 102 designates each bank of the set of banks as acontent data bank, and provides an address space that covers each bankof the set of banks to the corresponding processor device.

In some embodiments, when the memory controller 102 determines theconfiguration of a set of banks as a virtual dual port or virtualmulti-port configuration, the memory controller 102 designates i) atleast one bank of the set of banks as a parity bank, and ii) remainingbanks of the set of banks as content data banks. The content data banksstore content data and the parity bank storing parity data that isassociated with the content data banks and different from the contentdata. The memory controller 102 provides an address space that includesthe content data banks and omits the parity bank to the correspondingprocessor device.

In some embodiments, the memory controller 102 allocates the set ofbanks as a dual single port configuration, including designating a firstportion of the set of banks as first content data banks having a firstaddress space and designates a second, remaining portion of the set ofbanks as second content data banks having a second address space that isdistinct from the first address space, and providing the first andsecond address spaces to the corresponding processor device, the firstcontent data banks supporting concurrent memory operations with thesecond content data banks during the memory access cycle.

At least some of the various blocks, operations, and techniquesdescribed above may be implemented utilizing hardware, a processorexecuting firmware instructions, a processor executing softwareinstructions, or any combination thereof. When implemented utilizing aprocessor executing software or firmware instructions, the software orfirmware instructions may be stored in any computer readable memory suchas on a magnetic disk, an optical disk, or other storage medium, in aRAM or ROM or flash memory, processor, hard disk drive, optical diskdrive, tape drive, etc. The software or firmware instructions mayinclude machine readable instructions that, when executed by one or moreprocessors, cause the one or more processors to perform various acts.

When implemented in hardware, the hardware may comprise one or more ofdiscrete components, an integrated circuit, an application-specificintegrated circuit (ASIC), a programmable logic device (PLD), etc.

While the present invention has been described with reference tospecific examples, which are intended to be illustrative only and not tobe limiting of the invention, changes, additions and/or deletions may bemade to the disclosed embodiments without departing from the scope ofthe invention.

What is claimed is:
 1. A network switch device, comprising: a pluralityof processor devices configured to perform different respectivefunctions of the network switch device; a block of shared memory havinga plurality of single port memory banks, the block of shared memorybeing shared among the plurality of processor devices; a memorycontroller configured to allocate respective sets of banks among theplurality of single port memory banks to processor devices among theplurality of processor devices, and determine respective configurationsof the sets of memory banks as one of i) a single port configuration inwhich respective single port memory banks support a single read or writememory operation to a memory location in a memory access cycle, and ii)a virtual multi-port configuration in which respective single portmemory banks support two or more concurrent read or write memoryoperations to a same memory location, based on memory accessrequirements of the corresponding processor device.
 2. The networkswitch device of claim 1, wherein the memory controller is configured todetermine the respective configurations based on one or more of i) anestimated memory size requirement of the corresponding processor device,and ii) an estimated average frequency of access to the block of memoryby the corresponding processor device.
 3. The network switch device ofclaim 1, wherein the memory controller is configured to determine thememory access requirements of the plurality of processor devices duringa configuration stage of the network switch device that precedes anoperational stage of the network switch device.
 4. The network switchdevice of claim 1, wherein the memory controller is configured todetermine the memory access requirements using a device type of theprocessor device, wherein the device type is one of a plurality ofdifferent device types that correspond to respective predeterminedmemory access requirements.
 5. The network switch device of claim 4,wherein the memory controller is configured to determine a configurationof a set of memory banks as the virtual multi-port memory when thedevice type, of the processor device to which the set of memory banks isallocated, corresponds to a forwarding table lookup engine.
 6. Thenetwork switch device of claim 1, wherein when the memory controllerdetermines the configuration of a set of banks as a single portconfiguration, the memory controller designates each bank of the set ofbanks as a content data bank and provides an address space that coverseach bank of the set of banks to the corresponding processor device. 7.The network switch device of claim 1, wherein when the memory controllerdetermines the configuration of a set of banks as a virtual multi-portconfiguration, the memory controller designates i) at least one bank ofthe set of banks as a parity bank, and ii) remaining banks of the set ofbanks as content data banks, the content data banks storing content dataand the parity bank storing parity data that is associated with thecontent data banks and different from the content data, and provides anaddress space that includes the content data banks and omits the paritybank to the corresponding processor device.
 8. The network switch deviceof claim 1, wherein the memory controller is further configured toallocate the set of banks as a dual single port configuration, in whichthe memory controller designates a first portion of the set of banks asfirst content data banks having a first address space and designates asecond, remaining portion of the set of banks as second content databanks having a second address space that is distinct from the firstaddress space, and provides the first and second address spaces to thecorresponding processor device, the first content data banks supportingconcurrent memory operations with the second content data banks duringthe memory access cycle.
 9. The network switch device of claim 1,further comprising: a connectivity controller configured to couple theplurality of processor devices with the block of shared memory; whereinthe memory controller is configured to configure the connectivitycontroller to provide the respective processor devices with access tothe corresponding sets of banks according to the determinedconfigurations.
 10. The network switch device of claim 1, wherein thevirtual multi-port configuration is a virtual dual port configuration inwhich respective single port memory banks support two or more memoryaccess operations to a memory location in a memory access cycle, thememory access operations include one or more of a read and a writeoperation.
 11. The network switch device of claim 1, wherein the memoryaccess requirement is at least one of a memory size requirement and anaverage frequency of access requirement.
 12. A method for providingaccess to a block of shared memory having a plurality of single portmemory banks, the method comprising: allocating, by a memory controllerof a network switch device that includes the block of shared memory anda plurality of processor devices configured to perform differentrespective functions of the network switch device, respective sets ofbanks among the plurality of single port memory banks to processordevices among the plurality of processor devices, the block of sharedmemory being shared among a plurality of processor devices; determining,by the memory controller, respective configurations of the sets ofmemory banks as one of i) a single port configuration in whichrespective single port memory banks support a single read or writememory operation to a memory location in a memory access cycle, and ii)a virtual multi-port configuration in which respective single portmemory banks support two or more concurrent read or write memoryoperations to a same memory location, based on memory accessrequirements of the corresponding processor device; and configuring, bythe memory controller, a connectivity controller of the network switchdevice to couple the plurality of processor devices to the block ofshared memory and provide the respective processor devices with accessto the corresponding sets of banks according to the determinedconfigurations.
 13. The method of claim 12, wherein determining therespective configurations of the sets of memory banks comprisesdetermining the respective configurations based on one or more of i) anestimated memory size requirement of the corresponding processor device,and ii) an estimated average frequency of access to the block of memoryby the corresponding processor device.
 14. The method of claim 12,wherein determining the respective configurations of the sets of memorybanks comprises determining the memory access requirements of theplurality of processor devices during a configuration stage of thenetwork switch device that precedes an operational stage of the networkswitch device.
 15. The method of claim 12, wherein determining therespective configurations of the sets of memory banks comprisesdetermining the memory access requirements using a device type of theprocessor device, wherein the device type is one of a plurality ofdifferent device types that correspond to respective predeterminedmemory access requirements.
 16. The method of claim 15, whereindetermining the memory access requirements using the device type of theprocessor device comprises determining a configuration of a set ofmemory banks as the virtual multi-port memory when the device type, ofthe processor device to which the set of memory banks is allocated,corresponds to a forwarding table lookup.
 17. The method of claim 12,the method further comprising: when the memory controller determines theconfiguration of the set of banks as the single port configuration,designating each bank of the set of banks as a content data bank thatstores content data, and providing an address space that covers eachbank of the set of banks to the corresponding processor device.
 18. Themethod of claim 12, the method further comprising: when the memorycontroller determines the configuration of a set of banks as a virtualmulti-port configuration, designating i) at least one bank of the set ofbanks as a parity bank, and ii) remaining banks of the set of banks ascontent data banks, the content data banks storing content data and theparity bank storing parity data that is associated with the content databanks and different from the content data, and providing an addressspace that includes the content data banks and omits the parity bank tothe corresponding processor device.
 19. The method of claim 12, themethod further comprising: allocating the set of banks as a dual singleport configuration, including designating a first portion of the set ofbanks as first content data banks having a first address space anddesignates a second, remaining portion of the set of banks as secondcontent data banks having a second address space that is distinct fromthe first address space, and providing the first and second addressspaces to the corresponding processor device, the first content databanks supporting concurrent memory operations with the second contentdata banks during the memory access cycle.
 20. The method of claim 12,wherein configuring the connectivity controller comprises configuringthe connectivity controller to couple a processor device of theplurality of processor devices to the corresponding set of banks with avirtual dual port configuration in which respective single port memorybanks support two or more memory access operations to a memory locationin a memory access cycle, the memory access operations including one ormore of a read and a write operation.